package com.lpx.demo.demo.util;

import java.util.HashMap;

public class JsonResult extends HashMap<String, Object> {
    public static JsonResult success() {
        JsonResult result = new JsonResult();
        result.put("code", 200);
        result.put("msg", "");
        return result;
    }

    public static JsonResult error() {
        JsonResult result = new JsonResult();
        result.put("code", 500);
        result.put("msg", "服务异常");
        return result;
    }

    @Override
    public JsonResult put(String k, Object v) {
        JsonResult result = new JsonResult();
        super.put(k, v);
        return result;
    }
}
